package com.qding.park.manager.app.queue.handle;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.alibaba.fastjson.JSONObject;
import com.qding.park.common.core.constant.CacheKeyThree;
import com.qding.park.common.core.exceptions.BaseException;
import com.qding.park.common.core.exceptions.IExceptionHandle;
import com.qding.park.common.core.exceptions.business.adapter.AdapterException;
import com.qding.park.common.core.exceptions.business.manager.adapterfactory.AdapterProxyCreateFail;
import com.qding.park.common.core.redis.JedisClient;
import com.qding.park.common.core.redis.SerializeUtils;
import com.qding.park.manager.facade.queue.service.DelayCheckFacade;
import com.qding.park.manager.pojo.TbInvitecard;
import com.qding.park.manager.pojo.TbReserve;
import com.qding.park.manager.pojo.queue.QueueMsg;

/**
 * @ClassName InviteTimeOutHandle
 * @Description TODO(邀请单超时)
 * @author Administrator
 * @Date 2016年9月17日 下午4:04:55
 * @version 1.0.0
 */
@Component("inviteTimeOutHandle")
public class InviteTimeOutHandle extends AbstractAllHandle{
	/**
	 * @Field @inviteFacade : TODO(邀请单核心业务)
	 */
	@Autowired
	private DelayCheckFacade  delayCheckFacade;

	@Override
	void actualHandle(QueueMsg msg) throws BaseException {
		JSONObject data = (JSONObject) msg.getData();
		TbInvitecard tbInvitecard=SerializeUtils.unSerialize(data.toJSONString(), TbInvitecard.class);
		delayCheckFacade.inviteTimeOut(tbInvitecard);
		
	}

	@Override
	boolean failDiscardRollBacK(QueueMsg msg) {
		_log.error("邀请单超时回滚:"+msg);
		return true;
	}

}
